/* USER CODE BEGIN Header */
/**
 ******************************************************************************
 * @file    gpio.h
 * @brief   This file contains all the function prototypes for
 *          the gpio.c file
 ******************************************************************************
 * @attention
 *
 * Copyright (c) 2024 STMicroelectronics.
 * All rights reserved.
 *
 * This software is licensed under terms that can be found in the LICENSE file
 * in the root directory of this software component.
 * If no LICENSE file comes with this software, it is provided AS-IS.
 *
 ******************************************************************************
 */
/* USER CODE END Header */
/* Define to prevent recursive inclusion -------------------------------------*/
#ifndef __GPIO_H__
#define __GPIO_H__

#ifdef __cplusplus
extern "C"
{
#endif

/* Includes ------------------------------------------------------------------*/
#include "main.h"

/* USER CODE BEGIN Includes */
#include "sys.h"
    /* USER CODE END Includes */

    /* USER CODE BEGIN Private defines */

#define KEY2 HAL_GPIO_ReadPin(GPIOF, KEY1_Pin)          // KEY0°´¼üPC5
#define KEY0 HAL_GPIO_ReadPin(GPIOF, KEY2_Pin)          // KEY1°´¼üPA15
#define KEY1 HAL_GPIO_ReadPin(KEY3_GPIO_Port, KEY3_Pin) // WKUP°´¼üPA0

    // #define KEY0_PRES 0
    // #define KEY1_PRES 1
    // #define KEY2_PRES 2
    typedef struct
    {
        u8 Key_Press;
        u8 K0_S_Flag;
        u8 K0_L_Flag;
        u8 K1_S_Flag;
        u8 K1_L_Flag;
        u8 K2_S_Flag;
        u8 K2_L_Flag;
    } Key_State;

    void Key_Stat(void);
    /* USER CODE END Private defines */

    void MX_GPIO_Init(void);

    /* USER CODE BEGIN Prototypes */
    u8 KEY_Scan(u8 mode);
    /* USER CODE END Prototypes */

#ifdef __cplusplus
}
#endif
#endif /*__ GPIO_H__ */
